package com.common.supply.service.impl.business;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;
import com.common.supply.domain.entity.business.BankCode;
import com.common.supply.mapper.business.BankCodeMapper;
import com.common.supply.service.IBankCodeService;
import org.springframework.stereotype.Service;


/**
 * 银行编码Service业务层处理
 *
 * @author african-loan
 * @date 2021-12-30
 */
@Service
public class BankCodeServiceImpl extends ServiceImpl<BankCodeMapper, BankCode> implements IBankCodeService {


    @Override
    public BankCode getBankCodeByPayStackCode(String payStackCode) {
        QueryWrapper<BankCode> queryWrapper = new QueryWrapper<BankCode>()
                .eq("paystack_bank_code", payStackCode)
                .last("order by id desc limit 1");
        return getOne(queryWrapper);
    }
}
